import { createStore, applyMiddleware, combineReducers } from "redux";

//引入打印的中间件
import logger from "redux-logger";
//做异步
import thunk from "redux-thunk";
//使用redux-devtools ，控制台显示数据
import { composeWithDevTools } from "redux-devtools-extension";
import { homeReducer } from "./moudules/home";
import { shopReducer } from "./moudules/shop";
import { RegReducer } from "./moudules/register";
import {loginReducer  } from "./moudules/login";
import { cateReducer } from "./moudules/Cate";
import {detailReducer} from "./moudules/detail"
let reducer = combineReducers({
  login:loginReducer,
  home: homeReducer,
  shop: shopReducer,
  register:RegReducer,
  cate:cateReducer,
  detail:detailReducer,
  shop:shopReducer
});

//创建仓库
let store = createStore(
  reducer,
  composeWithDevTools(applyMiddleware(thunk, logger))
);

//导出仓库
export default store;


